#ifndef __MOTION_H
#define __MOTION_H
#include "rtdevice.h"
#include "rtthread.h"
#include "stepper.h"

#define COREXY
// #define XY

#define STEP_PER_MM 80.0f

struct vector3
{
    volatile float x;
    volatile float y;
    volatile float z;
};

struct motion_info
{
    struct vector3 position;
    struct vector3 velocity;
    float max_speed; // unit: mm/s
    struct stepper_device_t *stepper_x;
    struct stepper_device_t *stepper_y;
    volatile int32_t motion_lock;
};
extern struct motion_info motion;
void motion_goto(struct motion_info *ins, struct vector3 *dest);

#endif